Expand description
Actix is an actor framework.
Actors are objects which encapsulate state and behavior, they communicate exclusively by exchanging messages. Actix actors are implemented on top of Tokio.
Multiple actors can run in same thread. Actors can run in multiple threads using the Arbiter
API. Actors exchange typed messages.
§Features
- Async or sync actors
- Actor communication in a local/thread context
- Using Futures for asynchronous message handling
- Actor supervision
- Typed messages (no
Any
type) and generic messages are allowed - Runs on stable Rust 1.68+
§Other Documentation
Re-exports§
pub use crate::fut::ActorFuture;
pub use crate::fut::ActorFutureExt;
pub use crate::fut::ActorStream;
pub use crate::fut::ActorStreamExt;
pub use crate::fut::ActorTryFuture;
pub use crate::fut::ActorTryFutureExt;
pub use crate::fut::WrapFuture;
pub use crate::fut::WrapStream;
pub use crate::registry::ArbiterService;
pub use crate::registry::Registry;
pub use crate::registry::SystemRegistry;
pub use crate::registry::SystemService;
pub use crate::sync::SyncArbiter;
pub use crate::sync::SyncContext;
Modules§
- actors
- Helper actors
- clock
- Utilities for tracking time.
- dev
- The
actix
prelude for library developers. - fut
- Custom
Future
andStream
implementation withactix
support. - io
- prelude
- The
actix
prelude. - registry
- Actors registry
- sync
- Sync Actors support
- utils
Structs§
- Actor
Response - A helper type for representing different types of message responses.
- Addr
- The address of an actor.
- Arbiter
- An Arbiter represents a thread that provides an asynchronous execution environment for futures and functions.
- Arbiter
Handle - A handle for sending spawn and stop messages to an Arbiter.
- Atomic
Response - A specialized actor future holder for atomic asynchronous message handling.
- Context
- An actor execution context.
- Message
Result - A helper type that implements the
MessageResponse
trait. - Recipient
- The
Recipient
type allows to send one specific message to an actor. - Response
- Helper type for representing different type of message responses
- Spawn
Handle - A handle to a spawned future.
- Supervisor
- Actor supervisor
- System
- A manager for a per-thread distributed async runtime.
- System
Runner - Runner that keeps a System’s event loop alive until stop message is received.
- Weak
Addr - A weakly referenced counterpart to
Addr<A>
. - Weak
Recipient - A weakly referenced counterpart to
Recipient<M>
Enums§
- Actor
State - Actor execution state
- Mailbox
Error - The errors that can occur during the message delivery process.
- Running
Traits§
- Actor
- Actors are objects which encapsulate state and behavior.
- Actor
Context - Actor execution context.
- Async
Context - Asynchronous execution context.
- Handler
- Describes how to handle messages of a specific type.
- Message
- Represent message that can be handled by an actor.
- Stream
Handler - Stream handling for Actors.
- Supervised
- Actors with the ability to restart after failure.
Functions§
- run
- Starts the system and executes the supplied future.
- spawn
- Spawns a future on the current thread as a new task.
Type Aliases§
- Response
ActFuture - A specialized actor future for asynchronous message handling.
- Response
Future - A specialized future for asynchronous message handling.
Attribute Macros§
- main
macros
- Marks async main function as the
actix
system entry-point. - test
macros
- Marks async test functions to use the
actix
system entry-point.
Derive Macros§
- Message
macros
- Message
Response macros